package com.chujian.framework.util.crypto;

import cn.hutool.core.map.MapBuilder;
import cn.hutool.crypto.asymmetric.RSA;

import java.util.Map;

public class RsaUs {

    /**
     * 生成 Rsa 一对公私钥
     *
     * @return
     */
    public static Map<String, String> genRsaPairKey() {
        // RSA_ECB_PKCS1("RSA/ECB/PKCS1Padding")

        RSA rsa = new RSA();

        return MapBuilder.<String, String>create()
                .put("pri", rsa.getPrivateKeyBase64())
                .put("pub", rsa.getPublicKeyBase64())
                .build();
    }


}
